<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="/WEB-INF/jsp/header.jsp" %>

<% String title = "全安药业信息综合系统"; %>
<title><%=title %>
</title>
<style>
    .isDownload{
        display:none;
    }
    .showNoAuth{
        display:none;
        color:gray;
    }
</style>
<script type="text/javascript" src="${pageContext.request.contextPath }/js/My97DatePicker/WdatePicker.js"></script>
</head>

<!-- BEGIN BODY -->
<body class="fixed-top" style="background: #fff;">

<form id="plans" method="post">

</form>
<!-- ui-dialog -->
<div id="dialog" title="Dialog Title"  class="ui-dialog-content ui-widget-content">

</div>

<div class="modal fade" data-backdrop="static" tabindex="-1" id="myModal1">
    <!--窗口声明：-->
    <div class="modal-dialog modal-lg">
        <!-- 内容声明 -->
        <div class="modal-content">
            <br>
            <p style="margin-left:15px;">拼命下载中，请稍等 <span id="miao"></span> ……</p>
            <!-- 主体 -->
            <div class="modal-body">
                <div class="progress progress-info progress-striped">
                    <div id="sucessufl_bar" class="bar" style="width: 1%"></div>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- BEGIN CONTAINER -->
<!-- BEGIN PAGE -->
<!-- BEGIN PAGE CONTAINER-->
<div class="container-fluid" >
    <!-- BEGIN PAGE HEADER-->
    <div class="row-fluid">
        <div class="span12">
            <!-- BEGIN PAGE TITLE & BREADCRUMB-->
            <h3 class="page-title">
                数据清单下载到Excel
            </h3>
            <ul class="breadcrumb">
                <li>
                    <a href="${pageContext.request.contextPath}/user/index.do">系统首页Home</a>
                    <span class="divider">/</span>
                </li>
                <li class="active">
                    数据清单下载
                </li>
                <li class="pull-right search-wrap">
                    <form action="" class="hidden-phone">
                        <div class="input-append search-input-area">
                            <input class="" id="appendedInputButton" type="text">
                            <button class="btn" type="button"><i class="icon-search"></i></button>
                        </div>
                    </form>
                </li>
            </ul>
            <!-- END PAGE TITLE & BREADCRUMB-->
        </div>
    </div>
    <!-- END PAGE HEADER-->
    <!-- BEGIN PAGE CONTENT-->
    <div class="row-fluid" id="draggable_portlets">
        <!-- 流向情况-->
        <div class="span4 column sortable">
            <!-- BEGIN Portlet PORTLET-->
            <div class="widget red">
                <div class="widget-title">
                    <h4><i class="icon-edit"></i>全国权限每年【纯销下载】</h4>
                    <span class="tools">
                                <a class="icon-chevron-down" href="javascript:;"></a>
                                <a class="icon-remove" href="javascript:;"></a>
                             </span>
                </div>
                <div class="widget-body">
                    <div>
                        	【纯销】行为：
                        <br/>
                        <span class="showNoAuth">仅有全国权限时方可显示下载链接</span>
                        <a href="javascript:void(0);" onclick="download_2014_cxPlans()" class="isDownload">【Y14】 </a>
                        <a href="javascript:void(0);" onclick="download_2015_cxPlans()" class="isDownload">【Y15】</a>
                        <a href="javascript:void(0);" onclick="download_2016_cxPlans()" class="isDownload">【Y16】</a>
                        <a href="javascript:void(0);" onclick="download_2017_cxPlans()" class="isDownload">【Y17】</a>
                        <a href="javascript:void(0);" onclick="download_2018_cxPlans()" class="isDownload">【Y18】</a>
                        <a href="javascript:void(0);" onclick="download_2019_cxPlans()" class="isDownload">【Y19】</a>
                        <a href="javascript:void(0);" onclick="download_2018_cxPlans_newDev()" class="isDownload">【Y18新开发】</a>
                    </div>
                </div>
            </div>
            <!-- END Portlet PORTLET-->
            <!-- BEGIN Portlet PORTLET-->
            <div class="widget yellow">
                <div class="widget-title">
                    <h4><i class="icon-edit"></i> 全国权限连续两年【纯销下载】</h4>
                    <span class="tools">
                                <a class="icon-chevron-down" href="javascript:;"></a>
                                <a class="icon-remove" href="javascript:;"></a>
                             </span>
                </div>
                <div class="widget-body">
                    <div>
                        	【纯销】行为：
                        <br/>
                        <span class="showNoAuth">仅有全国权限时方可显示下载链接</span>
                        <a href="javascript:void(0);" onclick="download_2014_2015cxPlans()" class="isDownload">【Y14-Y15】</a>
                        <a href="javascript:void(0);" onclick="download_2015_2016cxPlans()" class="isDownload">【Y15-Y16】</a>
                        <a href="javascript:void(0);" onclick="download_2016_2017cxPlans()" class="isDownload">【Y16-Y17】</a>
                        <a href="javascript:void(0);" onclick="download_2017_2018cxPlans()" class="isDownload">【Y17-Y18】</a>
                        <a href="javascript:void(0);" onclick="download_2018_2019cxPlans()" class="isDownload">【Y18-Y19】</a>
                    </div>
                </div>
            </div>
            <!-- END Portlet PORTLET-->
            <!-- BEGIN Portlet PORTLET-->
            <div class="widget green">
                <div class="widget-title">
                    <h4><i class="icon-edit"></i>全国【所有行为】流向</h4>
                    <span class="tools">
                                <a class="icon-chevron-down" href="javascript:;"></a>
                                <a class="icon-remove" href="javascript:;"></a>
                             </span>
                </div>
                <div class="widget-body">
                    <div>
                        <span class="showNoAuth">仅有全国权限时方可显示下载链接</span>
                        <a href="javascript:void(0);" onclick="download_2014_allPlans()" class="isDownload">【Y14】</a>
                        <a href="javascript:void(0);" onclick="download_2015_allPlans()" class="isDownload">【Y15】</a>
                        <a href="javascript:void(0);" onclick="download_2016_allPlans()" class="isDownload">【Y16】</a>
                        <a href="javascript:void(0);" onclick="download_2017_allPlans()" class="isDownload">【Y17】</a>
                        <a href="javascript:void(0);" onclick="download_2018_allPlans()" class="isDownload">【Y18】</a>
                        <a href="javascript:void(0);" onclick="download_2019_allPlans()" class="isDownload">【Y19】</a>
                        <a href="javascript:void(0);" onclick="download_2017_2018_allPlans()" class="isDownload">【Y17-Y18】</a>
                        <a href="javascript:void(0);" onclick="download_2018_2019_allPlans()" class="isDownload">【Y18-Y19】</a>
                        <a href="javascript:void(0);" onclick="download_2018_2019_allPlans_J()" class="isDownload">【Y18-Y19简】</a>
                        <a href="javascript:void(0);" onclick="download_2018_2019_allPlans_Z()" class="isDownload">【Y18-Y19中】</a>
                        <a href="javascript:void(0);" onclick="download_2018_2019_allPlans_Q()" class="isDownload">【Y18-Y19全】</a>
                    </div>
                </div>
            </div>
            <!-- END Portlet PORTLET-->
            <div class="widget green">
                <div class="widget-title">
                    <h4><i class="icon-edit"></i>千盒区县、千盒终端 报表下载</h4>
                    <span class="tools">
                                <a class="icon-chevron-down" href="javascript:;"></a>
                                <a class="icon-remove" href="javascript:;"></a>
                             </span>
                </div>
                <div class="widget-body">
                    <div>
                        <a href="javascript:void(0);" onclick="download_CountryOver1kQ1('2018','1','3','A')" >【 千盒区县Q1】</a>
                        <a href="javascript:void(0);" onclick="download_CountryOver1kQ2('2018','4','6','A')" >【 千盒区县Q2】</a>
                        <a href="javascript:void(0);" onclick="download_CountryOver1kQ3('2018','7','9','A')" >【 千盒区县Q3】</a>
                        <a href="javascript:void(0);" onclick="download_CountryOver1kQ4('2018','10','12','A')" >【 千盒区县Q4】</a>
                      	<div style="margin-top: 5px;"></div>
                        <a href="javascript:void(0);" onclick="download_TerminalOver1kQ1('2018','1','3','A')" >【 千盒终端Q1】</a>
                        <a href="javascript:void(0);" onclick="download_TerminalOver1kQ2('2018','4','6','A')" >【 千盒终端Q2】</a>
                        <a href="javascript:void(0);" onclick="download_TerminalOver1kQ3('2018','7','9','A')" >【 千盒终端Q3】</a>
                        <a href="javascript:void(0);" onclick="download_TerminalOver1kQ4('2018','10','12','A')" >【 千盒终端Q4】</a>
                    </div>
                </div>
            </div>
        </div>
        <div class="span4 column sortable">
            <!-- BEGIN Portlet PORTLET-->
            <div class="widget purple">
                <div class="widget-title">
                    <h4><i class="icon-edit"></i> 经理权限连续两年【纯销下载】</h4>
                    <span class="tools">
                                <a class="icon-chevron-down" href="javascript:;"></a>
                                <a class="icon-remove" href="javascript:;"></a>
                             </span>
                </div>
                <div class="widget-body">
                    <div>
                        【纯销】行为：（以经理负责省份为单位）
                        <br>
                        <a href="javascript:void(0);" onclick="download_2014_2015cxPlans_self()">【Y14-Y15】</a>
                        <a href="javascript:void(0);" onclick="download_2015_2016cxPlans_self()">【Y15-Y16】</a>
                        <a href="javascript:void(0);" onclick="download_2016_2017cxPlans_self()">【Y16-Y17】</a>
                        <a href="javascript:void(0);" onclick="download_2017_2018cxPlans_self()">【Y17-Y18】</a>
                        <a href="javascript:void(0);" onclick="download_2018_2019cxPlans_self()">【Y18-Y19】</a>
                    </div>
                </div>
            </div>
            <!-- END Portlet PORTLET-->
            <!-- BEGIN Portlet PORTLET-->
            <div class="widget orange">
                <div class="widget-title">
                    <h4><i class="icon-edit"></i> 经理权限每年【纯销下载】</h4>
                    <span class="tools">
                                <a class="icon-chevron-down" href="javascript:;"></a>
                                <a class="icon-remove" href="javascript:;"></a>
                             </span>
                </div>
                <div class="widget-body">
                    <div>
                        【纯销】行为：（以经理负责省份为单位）
                        <br>
                        <a href="javascript:void(0);" onclick="download_2014cxPlans_self()">【Y14】</a>
                        <a href="javascript:void(0);" onclick="download_2015cxPlans_self()">【Y15】</a>
                        <a href="javascript:void(0);" onclick="download_2016cxPlans_self()">【Y16】</a>
                        <a href="javascript:void(0);" onclick="download_2017cxPlans_self()">【Y17】</a>
                        <a href="javascript:void(0);" onclick="download_2018cxPlans_self()">【Y18】</a>
                        <a href="javascript:void(0);" onclick="download_2019cxPlans_self()">【Y19】</a>
                    </div>
                </div>
            </div>
            <!-- END Portlet PORTLET-->
            <!-- BEGIN Portlet PORTLET-->
            <div class="widget blue">
                <div class="widget-title">
                    <h4><i class="icon-edit"></i> 经理权限每年【所有行为流向下载】</h4>
                    <span class="tools">
                                <a class="icon-chevron-down" href="javascript:;"></a>
                                <a class="icon-remove" href="javascript:;"></a>
                             </span>
                </div>
                <div class="widget-body">
                        <div>
                            【所有】行为：（以经理负责省份为单位）
                            <br>
                            <a href="javascript:void(0);" onclick="download_2014_allPlans_self()">【Y14】</a>
                            <a href="javascript:void(0);" onclick="download_2015_allPlans_self()">【Y15】</a>
                            <a href="javascript:void(0);" onclick="download_2016_allPlans_self()">【Y16】</a>
                            <a href="javascript:void(0);" onclick="download_2017_allPlans_self()">【Y17】</a>
                            <a href="javascript:void(0);" onclick="download_2018_allPlans_self()">【Y18】</a>
                            <a href="javascript:void(0);" onclick="download_2019_allPlans_self()">【Y19】</a>
                            <a href="javascript:void(0);" onclick="download_2017_2018_allPlans_self()">【Y17-Y18】</a>
                            <a href="javascript:void(0);" onclick="download_2018_2019_allPlans_self()">【Y18-Y19】</a>
                        </div>
                </div>
            </div>
            <!-- END Portlet PORTLET-->
			<div class="widget blue">
                <div class="widget-title">
                    <h4><i class="icon-edit"></i>报表下载</h4>
                    <span class="tools">
                                <a class="icon-chevron-down" href="javascript:;"></a>
                                <a class="icon-remove" href="javascript:;"></a>
                             </span>
                </div>
                <div class="widget-body">
                        <div>
                            	<a data-original-title=""
								href="${pageContext.request.contextPath }/plans/download_reportUI.do">
								<i class="icon-bar-chart"></i>
								<div class="info"></div>
								<div class="status">报表下载</div>
								</a>
                        </div>
                </div>
            </div>
        </div>
        <div class="span4 column sortable">
        <!-- BEGIN Portlet PORTLET-->
        <div class="widget">
            <div class="widget-title">
                <h4><i class="icon-edit"></i> 经理权限【协议政策下载】</h4>
                <span class="tools">
                    <a class="icon-chevron-down" href="javascript:;"></a>
                    <a class="icon-remove" href="javascript:;"></a>
                </span>
            </div>
            <div class="widget-body">
                <div>
                    下载协议，如发现不对的地方，请及时联系协议岗修改
                    <a href="javascript:void(0);" onclick="download_policy_self()">【下载自己省份的协议】</a>
                </div>
            </div>
        </div>
        <!-- END Portlet PORTLET-->
        <!-- BEGIN Portlet PORTLET-->
        <div class="widget purple">
            <div class="widget-title">
                <h4><i class="icon-edit"></i> 下载截止到该日期的理论库存</h4>
                <span class="tools">
                                <a class="icon-chevron-down" href="javascript:;"></a>
                                <a class="icon-remove" href="javascript:;"></a>
                             </span>
            </div>
            <div class="widget-body">
                <div style="margin-top: 5px;">
                   	请输入库存截至日期：
                   	<input type="text" name="kucunDate" id="kucunDate"
						class="Wdate" style="width: 120px;height:15px; margin-top: 5px;" 
						value = ""
						onfocus="WdatePicker({isShowClear:false,readOnly:false,dateFmt:'yyyy/MM/dd'})" />
					<a href="javascript:void(0);" onclick="download_time_kucun()">【下载】</a>
                </div>
            </div>
        </div>
        <!-- END Portlet PORTLET-->
        <!-- BEGIN Portlet PORTLET-->
        <div class="widget green">
            <div class="widget-title">
                <h4><i class="icon-edit"></i>下载所属省下所有经理的签到记录</h4>
                <span class="tools">
                                <a class="icon-chevron-down" href="javascript:;"></a>
                                <a class="icon-remove" href="javascript:;"></a>
                             </span>
            </div>
            <div class="widget-body">
                <div>
                   	开始日期：
                   	<input type="text" id="startTime"
						class="Wdate" style="width: 75px;height:15px; margin-top: 5px;" 
						value = ""
						onfocus="WdatePicker({isShowClear:false,readOnly:false,dateFmt:'yyyy/MM/dd'})" />
                   	结束日期：
                   	<input type="text" id="endTime"
						class="Wdate" style="width: 75px;height:15px; margin-top: 5px;" 
						value = ""
						onfocus="WdatePicker({isShowClear:false,readOnly:false,dateFmt:'yyyy/MM/dd'})" />
					<a href="javascript:void(0);" onclick="download_mgr_qiandao()">【下载】</a>
                   	
                </div>
            </div>
        </div>
        <!-- END Portlet PORTLET-->
        <div class="widget green">
            <div class="widget-title">
                <h4><i class="icon-edit"></i>全国协议</h4>
                <span class="tools">
                                <a class="icon-chevron-down" href="javascript:;"></a>
                                <a class="icon-remove" href="javascript:;"></a>
                             </span>
            </div>
            <div class="widget-body">
                <div>
                    <a href="javascript:void(0);" onclick="download_policy()">【下载全国所有协议】</a>
                </div>
            </div>
        </div>
    </div>

    </div>
    <!-- END PAGE CONTENT-->

</div>
<!-- END PAGE CONTAINER-->

<!-- BEGIN FOOTER -->
<div id="footer">2018 © 全安药业股份</div>
<!-- END FOOTER -->
<!-- Load javascripts at bottom, this will reduce page load time -->
<script src="${pageContext.request.contextPath}/js/jquery-1.8.3.min.js"></script>
<script src="${pageContext.request.contextPath}/js/jquery.nicescroll.js" type="text/javascript"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery.slimscroll.min.js"></script>
<script src="${pageContext.request.contextPath}/js/fullcalendar.min.js"></script>
<script src="${pageContext.request.contextPath}/js/bootstrap.min.js"></script>
<!-- ie8 fixes -->
<!--[if lt IE 9]>
<script src="${pageContext.request.contextPath}/js/excanvas.js"></script>
<script src="${pageContext.request.contextPath}/js/respond.js"></script>
<![endif]-->
<script src="${pageContext.request.contextPath}/js/jquery.easy-pie-chart.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/js/jquery.sparkline.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/js/Chart.js"></script>
<script src="${pageContext.request.contextPath}/js/jquery.scrollTo.min.js"></script>
<!--common script for all pages-->
<script src="${pageContext.request.contextPath}/js/common-scripts.js"></script>
<script src="${pageContext.request.contextPath}/js/jquery-ui-1.10.1.custom.min.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/js/draggable-portlet.js"></script>

<!-- END JAVASCRIPTS -->
<script>
    jQuery(document).ready(function () {
        DraggablePortlet.init();
    });
</script>
<script src="${pageContext.request.contextPath}/javascript/httpService.js"></script>
<!-- 自定义的script方法 -->
<script type="text/javascript">
	$(function(){
		//var value = new Date().getFullYear()+'/'+(new Date().getMonth()+1) + '/' + new Date().getDate();
		//var pre = new Date().getFullYear()+'/'+(new Date().getMonth()) + '/' + new Date().getDate();
		//$("#kucunDate").val(value);
		//$("#startTime").val(pre);
		//$("#endTime").val(value);
	});
</script>

<script type="text/javascript">
    var p = 0;
    var miao = 0;
    var stop = 0;
    var url;
    var count=0;
    var action = "no_request";
    //启动进度条
    function start_progress() {
        miao += 1;
        if(p == 100){
            p = 0;
        }
        p += 10; //进度条每秒走10个单位
        if(stop==1){//ajax返回success时，stop=1
            $("#sucessufl_bar").css("width", "100%");//进度条完成100%
            $('#myModal1').modal('hide');//隐藏模板
            count = 0;//还原count
            stop = 0;//还原stop
            miao = 0;//还原miao
            action = "no_request";//还原action
            //window.open(url);大部分浏览器会阻止弹框
            var f = document.createElement("form");
            f.target = '_blank';
            f.method = 'POST';
            document.body.appendChild(f);
            var i = document.createElement("input");
            i.type = "hidden";
            f.appendChild(i);
            i.value = "5";
            i.name = "price";
            f.action = url; //下载的url 地址
            console.log("url="+url);
            f.submit();
            return;
        }
        $("#sucessufl_bar").css("width", p + "%");
        $("#miao").html(miao);
        if(count == 1){
            if(action==="download_all") {
                var params = $("#plans").serialize();
                sendRequest(pageContextPath + "/plans/download_all.do", params, function (jsonData) {
                    stop = jsonData.sucessful;
                    var filePath  = jsonData.filePath;
                    url = pageContextPath+filePath;
                },true);
            }
            if(action==="download_all2017_2018Plans") {
                var params = $("#plans").serialize();
                sendRequest(pageContextPath + "/plans/download_all2017_2018Plans.do", params, function (jsonData) {
                    stop = jsonData.sucessful;
                    var filePath  = jsonData.filePath;
                    url = pageContextPath+filePath;
                },true);
            }
            if(action==="download_all_cx_2016_2018Plans") {
                var params = $("#plans").serialize();
                sendRequest(pageContextPath + "/plans/download_all_cx_2016_2018Plans.do", params, function (jsonData) {
                    stop = jsonData.sucessful;
                    var filePath  = jsonData.filePath;
                    url = pageContextPath+filePath;
                },true);
            }
            if(action==="download_allXsPlans") {
                var params = $("#plans").serialize();
                sendRequest(pageContextPath + "/plans/download_allXsPlans.do", params, function (jsonData) {
                    stop = jsonData.sucessful;
                    var filePath  = jsonData.filePath;
                    url = pageContextPath+filePath;
                },true);
            }
            if(action==="download_all2017Plans") {
                var params = $("#plans").serialize();
                sendRequest(pageContextPath + "/plans/download_all2017Plans.do", params, function (jsonData) {
                    stop = jsonData.sucessful;
                    var filePath  = jsonData.filePath;
                    url = pageContextPath+filePath;
                },true);
            }
            if(action==="download_all2017Plans_self") {
                var params = $("#plans").serialize();
                sendRequest(pageContextPath + "/plans/download_all2017Plans_self.do", params, function (jsonData) {
                    stop = jsonData.sucessful;
                    var filePath  = jsonData.filePath;
                    url = pageContextPath+filePath;
                },true);
            }

            //新开发终端流向情况
            if(action==="download_2018_cxPlans_newDev") {
                var params = $("#plans").serialize();
                sendRequest(pageContextPath + "/plans/download_2018_cxPlans_newDev.do", params, function (jsonData) {
                    stop = jsonData.sucessful;
                    var filePath  = jsonData.filePath;
                    url = pageContextPath+filePath;
                },true);
            }
            
            //全国每年纯销----------------------start------------------------------------------------------------
            if(action==="download_all2019CxPlans") {
                var params = $("#plans").serialize();
                sendRequest(pageContextPath + "/plans/download_all2019CxPlans.do", params, function (jsonData) {
                    stop = jsonData.sucessful;
                    var filePath  = jsonData.filePath;
                    url = pageContextPath+filePath;
                },true);
            }
            if(action==="download_all2018CxPlans") {
                var params = $("#plans").serialize();
                sendRequest(pageContextPath + "/plans/download_all2018CxPlans.do", params, function (jsonData) {
                    stop = jsonData.sucessful;
                    var filePath  = jsonData.filePath;
                    url = pageContextPath+filePath;
                },true);
            }
            if(action==="download_all2017CxPlans") {
                var params = $("#plans").serialize();
                sendRequest(pageContextPath + "/plans/download_all2017CxPlans.do", params, function (jsonData) {
                    stop = jsonData.sucessful;
                    var filePath  = jsonData.filePath;
                    url = pageContextPath+filePath;
                },true);
            }
            if(action==="download_all2016CxPlans") {
                var params = $("#plans").serialize();
                sendRequest(pageContextPath + "/plans/download_all2016CxPlans.do", params, function (jsonData) {
                    stop = jsonData.sucessful;
                    var filePath  = jsonData.filePath;
                    url = pageContextPath+filePath;
                },true);
            }
            if(action==="download_all2015CxPlans") {
                var params = $("#plans").serialize();
                sendRequest(pageContextPath + "/plans/download_all2015CxPlans.do", params, function (jsonData) {
                    stop = jsonData.sucessful;
                    var filePath  = jsonData.filePath;
                    url = pageContextPath+filePath;
                },true);
            }
            if(action==="download_all2014CxPlans") {
                var params = $("#plans").serialize();
                sendRequest(pageContextPath + "/plans/download_all2014CxPlans.do", params, function (jsonData) {
                    stop = jsonData.sucessful;
                    var filePath  = jsonData.filePath;
                    url = pageContextPath+filePath;
                },true);
            }
            //全国纯销--------------end--------------------------------------------------------------------

            //经理自己省份每年纯销---------------------start-------------------------
            //每年自己省份的
            if(action==="download_2014cxPlans_self") {
                var params = $("#plans").serialize();
                sendRequest(pageContextPath + "/plans/download_2014cxPlans_self.do", params, function (jsonData) {
                    stop = jsonData.sucessful;
                    var filePath  = jsonData.filePath;
                    url = pageContextPath+filePath;
                },true);
            }
            if(action==="download_2015cxPlans_self") {
                var params = $("#plans").serialize();
                sendRequest(pageContextPath + "/plans/download_2015cxPlans_self.do", params, function (jsonData) {
                    stop = jsonData.sucessful;
                    var filePath  = jsonData.filePath;
                    url = pageContextPath+filePath;
                },true);
            }
            if(action==="download_2016cxPlans_self") {
                var params = $("#plans").serialize();
                sendRequest(pageContextPath + "/plans/download_2016cxPlans_self.do", params, function (jsonData) {
                    stop = jsonData.sucessful;
                    var filePath  = jsonData.filePath;
                    url = pageContextPath+filePath;
                },true);
            }
            if(action==="download_2017cxPlans_self") {
                var params = $("#plans").serialize();
                sendRequest(pageContextPath + "/plans/download_2017cxPlans_self.do", params, function (jsonData) {
                    stop = jsonData.sucessful;
                    var filePath  = jsonData.filePath;
                    url = pageContextPath+filePath;
                },true);
            }
            if(action==="download_2018cxPlans_self") {
                var params = $("#plans").serialize();
                sendRequest(pageContextPath + "/plans/download_2018cxPlans_self.do", params, function (jsonData) {
                    stop = jsonData.sucessful;
                    var filePath  = jsonData.filePath;
                    url = pageContextPath+filePath;
                },true);
            }
            if(action==="download_2019cxPlans_self") {
                var params = $("#plans").serialize();
                sendRequest(pageContextPath + "/plans/download_2019cxPlans_self.do", params, function (jsonData) {
                    stop = jsonData.sucessful;
                    var filePath  = jsonData.filePath;
                    url = pageContextPath+filePath;
                },true);
            }
            //经理自己省份每年纯销---------------------end-------------------------

            //全国所有行为流向-------------start------------
            if(action==="download_2014_allPlans") {
                var params = $("#plans").serialize();
                sendRequest(pageContextPath + "/plans/download_2014_allPlans.do", params, function (jsonData) {
                    stop = jsonData.sucessful;
                    var filePath  = jsonData.filePath;
                    url = pageContextPath+filePath;
                },true);
            }
            if(action==="download_2015_allPlans") {
                var params = $("#plans").serialize();
                sendRequest(pageContextPath + "/plans/download_2015_allPlans.do", params, function (jsonData) {
                    stop = jsonData.sucessful;
                    var filePath  = jsonData.filePath;
                    url = pageContextPath+filePath;
                },true);
            }
            if(action==="download_2016_allPlans") {
                var params = $("#plans").serialize();
                sendRequest(pageContextPath + "/plans/download_2016_allPlans.do", params, function (jsonData) {
                    stop = jsonData.sucessful;
                    var filePath  = jsonData.filePath;
                    url = pageContextPath+filePath;
                },true);
            }
            if(action==="download_2017_allPlans") {
                var params = $("#plans").serialize();
                sendRequest(pageContextPath + "/plans/download_2017_allPlans.do", params, function (jsonData) {
                    stop = jsonData.sucessful;
                    var filePath  = jsonData.filePath;
                    url = pageContextPath+filePath;
                },true);
            }
            if(action==="download_2018_allPlans") {
                var params = $("#plans").serialize();
                sendRequest(pageContextPath + "/plans/download_2018_allPlans.do", params, function (jsonData) {
                    stop = jsonData.sucessful;
                    var filePath  = jsonData.filePath;
                    url = pageContextPath+filePath;
                },true);
            }
            if(action==="download_2019_allPlans") {
                var params = $("#plans").serialize();
                sendRequest(pageContextPath + "/plans/download_2019_allPlans.do", params, function (jsonData) {
                    stop = jsonData.sucessful;
                    var filePath  = jsonData.filePath;
                    url = pageContextPath+filePath;
                },true);
            }
            if(action==="download_2017_2018_allPlans") {
                var params = $("#plans").serialize();
                sendRequest(pageContextPath + "/plans/download_2017_2018_allPlans.do", params, function (jsonData) {
                    stop = jsonData.sucessful;
                    var filePath  = jsonData.filePath;
                    url = pageContextPath+filePath;
                },true);
            }
            if(action==="download_2018_2019_allPlans") {
                var params = $("#plans").serialize();
                sendRequest(pageContextPath + "/plans/download_2018_2019_allPlans.do", params, function (jsonData) {
                    stop = jsonData.sucessful;
                    var filePath  = jsonData.filePath;
                    url = pageContextPath+filePath;
                },true);
            }
            if(action==="download_2018_2019_allPlans_J") {
                var params = $("#plans").serialize();
                sendRequest(pageContextPath + "/plans/download_2018_2019_allPlans_J.do", params, function (jsonData) {
                    stop = jsonData.sucessful;
                    var filePath  = jsonData.filePath;
                    url = pageContextPath+filePath;
                },true);
            }
            if(action==="download_2018_2019_allPlans_Z") {
                var params = $("#plans").serialize();
                sendRequest(pageContextPath + "/plans/download_2018_2019_allPlans_Z.do", params, function (jsonData) {
                    stop = jsonData.sucessful;
                    var filePath  = jsonData.filePath;
                    url = pageContextPath+filePath;
                },true);
            }
            if(action==="download_2018_2019_allPlans_Q") {
                var params = $("#plans").serialize();
                sendRequest(pageContextPath + "/plans/download_2018_2019_allPlans_Q.do", params, function (jsonData) {
                    stop = jsonData.sucessful;
                    var filePath  = jsonData.filePath;
                    url = pageContextPath+filePath;
                },true);
            }
            //全国所有行为流向-------------end------------

            //经理下载自己的协议 ----------------start---------------------------------------------
            if(action==="download_policy_self") {
                var params = $("#plans").serialize();
                sendRequest(pageContextPath + "/plans/download_policy_self.do", params, function (jsonData) {
                    stop = jsonData.sucessful;
                    var filePath  = jsonData.filePath;
                    url = pageContextPath+filePath;
                },true);
            }
            //经理下载自己的协议 ----------------end---------------------------------------------

            
            if(action==="download_policy") {
                var params = $("#plans").serialize();
                sendRequest(pageContextPath + "/plans/download_policy.do", params, function (jsonData) {
                    stop = jsonData.sucessful;
                    var filePath  = jsonData.filePath;
                    url = pageContextPath+filePath;
                },true);
            }

            //经理自己省份每年所有的流向-------------------start-------------------------
            //每年自己省份的
            if(action==="download_2014_allPlans_self") {
                var params = $("#plans").serialize();
                sendRequest(pageContextPath + "/plans/download_2014_allPlans_self.do", params, function (jsonData) {
                    stop = jsonData.sucessful;
                    var filePath  = jsonData.filePath;
                    url = pageContextPath+filePath;
                },true);
            }
            if(action==="download_2015_allPlans_self") {
                var params = $("#plans").serialize();
                sendRequest(pageContextPath + "/plans/download_2015_allPlans_self.do", params, function (jsonData) {
                    stop = jsonData.sucessful;
                    var filePath  = jsonData.filePath;
                    url = pageContextPath+filePath;
                },true);
            }
            if(action==="download_2016_allPlans_self") {
                var params = $("#plans").serialize();
                sendRequest(pageContextPath + "/plans/download_2016_allPlans_self.do", params, function (jsonData) {
                    stop = jsonData.sucessful;
                    var filePath  = jsonData.filePath;
                    url = pageContextPath+filePath;
                },true);
            }
            if(action==="download_2017_allPlans_self") {
                var params = $("#plans").serialize();
                sendRequest(pageContextPath + "/plans/download_2017_allPlans_self.do", params, function (jsonData) {
                    stop = jsonData.sucessful;
                    var filePath  = jsonData.filePath;
                    url = pageContextPath+filePath;
                },true);
            }
            if(action==="download_2018_allPlans_self") {
                var params = $("#plans").serialize();
                sendRequest(pageContextPath + "/plans/download_2018_allPlans_self.do", params, function (jsonData) {
                    stop = jsonData.sucessful;
                    var filePath  = jsonData.filePath;
                    url = pageContextPath+filePath;
                },true);
            }
            if(action==="download_2019_allPlans_self") {
                var params = $("#plans").serialize();
                sendRequest(pageContextPath + "/plans/download_2019_allPlans_self.do", params, function (jsonData) {
                    stop = jsonData.sucessful;
                    var filePath  = jsonData.filePath;
                    url = pageContextPath+filePath;
                },true);
            }
            if(action==="download_2017_2018_allPlans_self") {
                var params = $("#plans").serialize();
                sendRequest(pageContextPath + "/plans/download_2017_2018_allPlans_self.do", params, function (jsonData) {
                    stop = jsonData.sucessful;
                    var filePath  = jsonData.filePath;
                    url = pageContextPath+filePath;
                },true);
            }
            if(action==="download_2018_2019_allPlans_self") {
                var params = $("#plans").serialize();
                sendRequest(pageContextPath + "/plans/download_2018_2019_allPlans_self.do", params, function (jsonData) {
                    stop = jsonData.sucessful;
                    var filePath  = jsonData.filePath;
                    url = pageContextPath+filePath;
                },true);
            }
            //经理自己省份每年纯销---------------------end-------------------------

            //全国连续2年纯销----------------------start-------------------------
            if(action==="download_all2014_2015CxPlans") {
                var params = $("#plans").serialize();
                sendRequest(pageContextPath + "/plans/download_all2014_2015CxPlans.do", params, function (jsonData) {
                    stop = jsonData.sucessful;
                    var filePath  = jsonData.filePath;
                    url = pageContextPath+filePath;
                },true);
            }
            if(action==="download_all2015_2016CxPlans") {
                var params = $("#plans").serialize();
                sendRequest(pageContextPath + "/plans/download_all2015_2016CxPlans.do", params, function (jsonData) {
                    stop = jsonData.sucessful;
                    var filePath  = jsonData.filePath;
                    url = pageContextPath+filePath;
                },true);
            }
            if(action==="download_all2016_2017CxPlans") {
                var params = $("#plans").serialize();
                sendRequest(pageContextPath + "/plans/download_all2016_2017CxPlans.do", params, function (jsonData) {
                    stop = jsonData.sucessful;
                    var filePath  = jsonData.filePath;
                    url = pageContextPath+filePath;
                },true);
            }
            if(action==="download_all2017_2018CxPlans") {
                var params = $("#plans").serialize();
                sendRequest(pageContextPath + "/plans/download_all2017_2018CxPlans.do", params, function (jsonData) {
                    stop = jsonData.sucessful;
                    var filePath  = jsonData.filePath;
                    url = pageContextPath+filePath;
                },true);
            }
            if(action==="download_all2018_2019CxPlans") {
                var params = $("#plans").serialize();
                sendRequest(pageContextPath + "/plans/download_all2018_2019CxPlans.do", params, function (jsonData) {
                    stop = jsonData.sucessful;
                    var filePath  = jsonData.filePath;
                    url = pageContextPath+filePath;
                },true);
            }
            //全国连续2年纯销----------------------end-------------------------

            //经理自己省份连续2年纯销----------------------start-------------------------
            //自己省份的
            if(action==="download_2014_2015cxPlans_self") {
                var params = $("#plans").serialize();
                sendRequest(pageContextPath + "/plans/download_2014_2015cxPlans_self.do", params, function (jsonData) {
                    stop = jsonData.sucessful;
                    var filePath  = jsonData.filePath;
                    url = pageContextPath+filePath;
                },true);
            }
            if(action==="download_2015_2016cxPlans_self") {
                var params = $("#plans").serialize();
                sendRequest(pageContextPath + "/plans/download_2015_2016cxPlans_self.do", params, function (jsonData) {
                    stop = jsonData.sucessful;
                    var filePath  = jsonData.filePath;
                    url = pageContextPath+filePath;
                },true);
            }
            if(action==="download_2016_2017cxPlans_self") {
                var params = $("#plans").serialize();
                sendRequest(pageContextPath + "/plans/download_2016_2017cxPlans_self.do", params, function (jsonData) {
                    stop = jsonData.sucessful;
                    var filePath  = jsonData.filePath;
                    url = pageContextPath+filePath;
                },true);
            }
            if(action==="download_2017_2018cxPlans_self") {
                var params = $("#plans").serialize();
                sendRequest(pageContextPath + "/plans/download_2017_2018cxPlans_self.do", params, function (jsonData) {
                    stop = jsonData.sucessful;
                    var filePath  = jsonData.filePath;
                    url = pageContextPath+filePath;
                },true);
            }
            if(action==="download_2018_2019cxPlans_self") {
                var params = $("#plans").serialize();
                sendRequest(pageContextPath + "/plans/download_2018_2019cxPlans_self.do", params, function (jsonData) {
                    stop = jsonData.sucessful;
                    var filePath  = jsonData.filePath;
                    url = pageContextPath+filePath;
                },true);
            }
            //经理自己省份连续2年纯销----------------------end-------------------------

            //全国连续2年销售----------------------start-------------------------
            if(action==="download_all2014_2015XsPlans") {
                var params = $("#plans").serialize();
                sendRequest(pageContextPath + "/plans/download_all2014_2015XsPlans.do", params, function (jsonData) {
                    stop = jsonData.sucessful;
                    var filePath  = jsonData.filePath;
                    url = pageContextPath+filePath;
                },true);
            }
            if(action==="download_all2015_2016XsPlans") {
                var params = $("#plans").serialize();
                sendRequest(pageContextPath + "/plans/download_all2015_2016XsPlans.do", params, function (jsonData) {
                    stop = jsonData.sucessful;
                    var filePath  = jsonData.filePath;
                    url = pageContextPath+filePath;
                },true);
            }
            if(action==="download_all2016_2017XsPlans") {
                var params = $("#plans").serialize();
                sendRequest(pageContextPath + "/plans/download_all2016_2017XsPlans.do", params, function (jsonData) {
                    stop = jsonData.sucessful;
                    var filePath  = jsonData.filePath;
                    url = pageContextPath+filePath;
                },true);
            }
            if(action==="download_all2017_2018XsPlans") {
                var params = $("#plans").serialize();
                sendRequest(pageContextPath + "/plans/download_all2017_2018XsPlans.do", params, function (jsonData) {
                    stop = jsonData.sucessful;
                    var filePath  = jsonData.filePath;
                    url = pageContextPath+filePath;
                },true);
            }
            //全国连续2年销售----------------------end-------------------------

            //经理自己省份连续2年销售---------------------start-------------------------
            //自己省份销售
            if(action==="download_2014_2015xsPlans_self") {
                var params = $("#plans").serialize();
                sendRequest(pageContextPath + "/plans/download_2014_2015xsPlans_self.do", params, function (jsonData) {
                    stop = jsonData.sucessful;
                    var filePath  = jsonData.filePath;
                    url = pageContextPath+filePath;
                },true);
            }
            if(action==="download_2015_2016xsPlans_self") {
                var params = $("#plans").serialize();
                sendRequest(pageContextPath + "/plans/download_2015_2016xsPlans_self.do", params, function (jsonData) {
                    stop = jsonData.sucessful;
                    var filePath  = jsonData.filePath;
                    url = pageContextPath+filePath;
                },true);
            }
            if(action==="download_2016_2017xsPlans_self") {
                var params = $("#plans").serialize();
                sendRequest(pageContextPath + "/plans/download_2016_2017xsPlans_self.do", params, function (jsonData) {
                    stop = jsonData.sucessful;
                    var filePath  = jsonData.filePath;
                    url = pageContextPath+filePath;
                },true);
            }
            if(action==="download_2017_2018xsPlans_self") {
                var params = $("#plans").serialize();
                sendRequest(pageContextPath + "/plans/download_2017_2018xsPlans_self.do", params, function (jsonData) {
                    stop = jsonData.sucessful;
                    var filePath  = jsonData.filePath;
                    url = pageContextPath+filePath;
                },true);
            }
            //经理自己省份连续2年销售---------------------end-------------------------



            if(action==="download_all2017CxPlans_self") {
                var params = $("#plans").serialize();
                sendRequest(pageContextPath + "/plans/download_all2017CxPlans_self.do", params, function (jsonData) {
                    stop = jsonData.sucessful;
                    var filePath  = jsonData.filePath;
                    url = pageContextPath+filePath;
                },true);
            }
            if(action==="download_all2017XsPlans") {
                var params = $("#plans").serialize();
                sendRequest(pageContextPath + "/plans/download_all2017XsPlans.do", params, function (jsonData) {
                    stop = jsonData.sucessful;
                    var filePath  = jsonData.filePath;
                    url = pageContextPath+filePath;
                },true);
            }
            if(action==="download_all2017XsPlans_self") {
                var params = $("#plans").serialize();
                sendRequest(pageContextPath + "/plans/download_all2017XsPlans_self.do", params, function (jsonData) {
                    stop = jsonData.sucessful;
                    var filePath  = jsonData.filePath;
                    url = pageContextPath+filePath;
                },true);
            }
            if(action==="download_all2018Plans") {
                var params = $("#plans").serialize();
                sendRequest(pageContextPath + "/plans/download_all2018Plans.do", params, function (jsonData) {
                    stop = jsonData.sucessful;
                    var filePath  = jsonData.filePath;
                    url = pageContextPath+filePath;
                },true);
            }
            if(action==="download_all2018Plans_self") {
                var params = $("#plans").serialize();
                sendRequest(pageContextPath + "/plans/download_all2018Plans_self.do", params, function (jsonData) {
                    stop = jsonData.sucessful;
                    var filePath  = jsonData.filePath;
                    url = pageContextPath+filePath;
                },true);
            }

            if(action==="download_all2018CxPlans_self") {
                var params = $("#plans").serialize();
                sendRequest(pageContextPath + "/plans/download_all2018CxPlans_self.do", params, function (jsonData) {
                    stop = jsonData.sucessful;
                    var filePath  = jsonData.filePath;
                    url = pageContextPath+filePath;
                },true);
            }
            if(action==="download_all2018XsPlans") {
                var params = $("#plans").serialize();
                sendRequest(pageContextPath + "/plans/download_all2018XsPlans.do", params, function (jsonData) {
                    stop = jsonData.sucessful;
                    var filePath  = jsonData.filePath;
                    url = pageContextPath+filePath;
                },true);
            }
            if(action==="download_all2018XsPlans_self") {
                var params = $("#plans").serialize();
                sendRequest(pageContextPath + "/plans/download_all2018XsPlans_self.do", params, function (jsonData) {
                    stop = jsonData.sucessful;
                    var filePath  = jsonData.filePath;
                    url = pageContextPath+filePath;
                },true);
            }
            //下载时间理论库存
            if(action==="downloadTimeInventory") {
                var endTime = $("#kucunDate").val();
                var params = {"endTime":endTime};
                sendRequest(pageContextPath + "/plan/downloadTimeInventory.do", params, function (jsonData) {
                    stop = jsonData.sucessful;
                    var filePath  = jsonData.filePath;
                    url = pageContextPath+filePath;
                },true);
            }
            //下载经理签到
            if(action==="downloadMgrQianDao") {
                var startTime = $("#startTime").val();
                var endTime = $("#endTime").val();
                var params = {"startTime":startTime,"endTime":endTime};
                sendRequest(pageContextPath + "/plan/downloadMgrQianDao.do", params, function (jsonData) {
                    stop = jsonData.sucessful;
                    var filePath  = jsonData.filePath;
                    url = pageContextPath+filePath;
                },true);
            }
            //下载千盒区县
            if(action==="downloadCountryOver1k") {
                var params = {"startMonth":startMonth,"endMonth":endMonth,"year":year,"product":product};
                sendRequest(pageContextPath + "/plan/downloadCountryOver1k.do", params, function (jsonData) {
                    stop = jsonData.sucessful;
                    var filePath  = jsonData.filePath;
                    url = pageContextPath+filePath;
                },true);
            }
            //下载千盒终端
            if(action==="download_TerminalOver1k") {
                var params = {"startMonth":startMonth,"endMonth":endMonth,"year":year,"product":product};
                sendRequest(pageContextPath + "/plan/downloadTerminalOver1k.do", params, function (jsonData) {
                    stop = jsonData.sucessful;
                    var filePath  = jsonData.filePath;
                    url = pageContextPath+filePath;
                },true);
            }
        }
        count += 1;
        //每秒执行一次
        var timer = setTimeout("start_progress()", 1000);
    }
    //数据量过大，下载不了，通过工程师去数据库直接导出。
    function fail_download_all() {
        //$('#notice').modal('show');
        $("#dialog").html("");
        var html = '<p>数据量过大，请不要浪费时间下载，请联系全安工程师获取相关数据！</p>';
        $("#dialog").html(html);
        $("#dialog" ).dialog( "open" );
    }
    //提示对话框
    $( "#dialog" ).dialog({
        autoOpen: false,
        width: 600,
        title:'<%=title%>',
        buttons: [
            {
                text: "知道了",
                click: function() {
                    $( this ).dialog( "close" );
                }
            }
        ]
    });

    //下载所有流向
    function download_all() {
        $('#myModal1').modal('show');
        //调用进度条
        start_progress();
        action = "download_all";
    }
    //下载2016-2018所有的流向
    function download_all2017_2018Plans() {
        $('#myModal1').modal('show');
        //调用进度条
        start_progress();
        action = "download_all2017_2018Plans";
    }
    //下载2016-2018所有的纯销流向
    function download_all_cx_2016_2018Plans() {
        $('#myModal1').modal('show');
        //调用进度条
        start_progress();
        action = "download_all_cx_2016_2018Plans";
    }
    //下载所有的销售流向
    function download_allXsPlans() {
        $('#myModal1').modal('show');
        //调用进度条
        start_progress();
        action = "download_allXsPlans";
    }
    //下载2017年所有流向
    function download_all2017Plans() {
        $('#myModal1').modal('show');
        //调用进度条
        start_progress();
        action = "download_all2017Plans";
    }
    //下载2017年所有流向 自己省份的
    function download_all2017Plans_self() {
        $('#myModal1').modal('show');
        //调用进度条
        start_progress();
        action = "download_all2017Plans_self";
    }
    //下载2017年纯销流向
    function download_all2017CxPlans() {
        $('#myModal1').modal('show');
        //调用进度条
        start_progress();
        action = "download_all2017CxPlans";
    }
    //下载2017年纯销流向 自己省份的
    function download_all2017CxPlans_self() {
        $('#myModal1').modal('show');
        //调用进度条
        start_progress();
        action = "download_all2017CxPlans_self";
    }
    //下载2017年销售流向
    function download_all2017XsPlans() {
        $('#myModal1').modal('show');
        //调用进度条
        start_progress();
        action = "download_all2017XsPlans";
    }
    //下载2017年销售流向 自己省份的
    function download_all2017XsPlans_self() {
        $('#myModal1').modal('show');
        //调用进度条
        start_progress();
        action = "download_all2017XsPlans_self";
    }

    //下载2018年全国纯销新开发流向
    function download_2018_cxPlans_newDev() {
        $('#myModal1').modal('show');
        //调用进度条
        start_progress();
        action = "download_2018_cxPlans_newDev";
    }
    //下载2019年全国纯销流向
    function download_2019_cxPlans() {
        $('#myModal1').modal('show');
        //调用进度条
        start_progress();
        action = "download_all2019CxPlans";
    }
    //下载2018年全国纯销流向
    function download_2018_cxPlans() {
        $('#myModal1').modal('show');
        //调用进度条
        start_progress();
        action = "download_all2018CxPlans";
    }
    //下载2017年全国纯销流向
    function download_2017_cxPlans() {
        $('#myModal1').modal('show');
        //调用进度条
        start_progress();
        action = "download_all2017CxPlans";
    }
    //下载2016年全国纯销流向
    function download_2016_cxPlans() {
        $('#myModal1').modal('show');
        //调用进度条
        start_progress();
        action = "download_all2016CxPlans";
    }
    //下载2015年全国纯销流向
    function download_2015_cxPlans() {
        $('#myModal1').modal('show');
        //调用进度条
        start_progress();
        action = "download_all2015CxPlans";
    }
    //下载2014年全国纯销流向
    function download_2014_cxPlans() {
        $('#myModal1').modal('show');
        //调用进度条
        start_progress();
        action = "download_all2014CxPlans";
    }

    //全国连续2年纯销----------------start-------------------------
    //下载2014-2015年全国纯销流向
    function download_2014_2015cxPlans() {
        $('#myModal1').modal('show');
        //调用进度条
        start_progress();
        action = "download_all2014_2015CxPlans";
    }
    //下载2015-2016年全国纯销流向
    function download_2015_2016cxPlans() {
        $('#myModal1').modal('show');
        //调用进度条
        start_progress();
        action = "download_all2015_2016CxPlans";
    }
    //下载2016-2017年全国纯销流向
    function download_2016_2017cxPlans() {
        $('#myModal1').modal('show');
        //调用进度条
        start_progress();
        action = "download_all2016_2017CxPlans";
    }
    //下载2017-2018年全国纯销流向
    function download_2017_2018cxPlans() {
        $('#myModal1').modal('show');
        //调用进度条
        start_progress();
        action = "download_all2017_2018CxPlans";
    }
    //下载2018-2019年全国纯销流向
    function download_2018_2019cxPlans() {
        $('#myModal1').modal('show');
        //调用进度条
        start_progress();
        action = "download_all2018_2019CxPlans";
    }
    //全国连续2年纯销----------------------end-------------------------

    //经理自己省份连续2年纯销----------------------start-------------------------
    //下载2014-2015年全国纯销流向 自己省份
    function download_2014_2015cxPlans_self() {
        $('#myModal1').modal('show');
        //调用进度条
        start_progress();
        action = "download_2014_2015cxPlans_self";
    }
    //下载2015-2016年全国纯销流向 自己省份
    function download_2015_2016cxPlans_self() {
        $('#myModal1').modal('show');
        //调用进度条
        start_progress();
        action = "download_2015_2016cxPlans_self";
    }
    //下载2016-2017年全国纯销流向 自己省份
    function download_2016_2017cxPlans_self() {
        $('#myModal1').modal('show');
        //调用进度条
        start_progress();
        action = "download_2016_2017cxPlans_self";
    }
    //下载2017-2018年全国纯销流向 自己省份
    function download_2017_2018cxPlans_self() {
        $('#myModal1').modal('show');
        //调用进度条
        start_progress();
        action = "download_2017_2018cxPlans_self";
    }
    //下载2018-2019年全国纯销流向 自己省份
    function download_2018_2019cxPlans_self() {
        $('#myModal1').modal('show');
        //调用进度条
        start_progress();
        action = "download_2018_2019cxPlans_self";
    }
    //经理自己省份连续2年纯销----------------------end-------------------------

    //全国连续2年销售----------------------start-------------------------
    //下载2014-2015年全国销售流向
    function download_2014_2015xsPlans() {
        $('#myModal1').modal('show');
        //调用进度条
        start_progress();
        action = "download_all2014_2015XsPlans";
    }
    //下载2015-2016年全国销售流向
    function download_2015_2016xsPlans() {
        $('#myModal1').modal('show');
        //调用进度条
        start_progress();
        action = "download_all2015_2016XsPlans";
    }
    //下载2016-2017年全国销售流向
    function download_2016_2017xsPlans() {
        $('#myModal1').modal('show');
        //调用进度条
        start_progress();
        action = "download_all2016_2017XsPlans";
    }
    //下载2017-2018年全国销售流向
    function download_2017_2018xsPlans() {
        $('#myModal1').modal('show');
        //调用进度条
        start_progress();
        action = "download_all2017_2018XsPlans";
    }
    //全国连续2年销售---------------------end-------------------------

    //经理自己省份连续2年销售---------------------start-------------------------
    //下载2014-2015年经理自己省份销售流向
    function download_2014_2015xsPlans_self() {
        $('#myModal1').modal('show');
        //调用进度条
        start_progress();
        action = "download_2014_2015xsPlans_self";
    }
    //下载2015-2016年经理自己省份销售流向
    function download_2015_2016xsPlans_self() {
        $('#myModal1').modal('show');
        //调用进度条
        start_progress();
        action = "download_2015_2016xsPlans_self";
    }
    //下载2016-2017年经理自己省份销售流向
    function download_2016_2017xsPlans_self() {
        $('#myModal1').modal('show');
        //调用进度条
        start_progress();
        action = "download_2016_2017xsPlans_self";
    }
    //下载2017-2018年经理自己省份销售流向
    function download_2017_2018xsPlans_self() {
        $('#myModal1').modal('show');
        //调用进度条
        start_progress();
        action = "download_2017_2018xsPlans_self";
    }
    //经理自己省份连续2年销售---------------------end-------------------------

    //经理自己省份每年纯销---------------------start-------------------------
    //下载2014年经理自己省份销售流向
    function download_2014cxPlans_self() {
        $('#myModal1').modal('show');
        //调用进度条
        start_progress();
        action = "download_2014cxPlans_self";
    }
    //下载2015年经理自己省份销售流向
    function download_2015cxPlans_self() {
        $('#myModal1').modal('show');
        //调用进度条
        start_progress();
        action = "download_2015cxPlans_self";
    }
    //下载2016年经理自己省份销售流向
    function download_2016cxPlans_self() {
        $('#myModal1').modal('show');
        //调用进度条
        start_progress();
        action = "download_2016cxPlans_self";
    }
    //下载2017年经理自己省份销售流向
    function download_2017cxPlans_self() {
        $('#myModal1').modal('show');
        //调用进度条
        start_progress();
        action = "download_2017cxPlans_self";
    }
    //下载2018年经理自己省份销售流向
    function download_2018cxPlans_self() {
        $('#myModal1').modal('show');
        //调用进度条
        start_progress();
        action = "download_2018cxPlans_self";
    }
    //下载2019年经理自己省份销售流向
    function download_2019cxPlans_self() {
        $('#myModal1').modal('show');
        //调用进度条
        start_progress();
        action = "download_2019cxPlans_self";
    }
    //经理自己省份每年纯销---------------------end-------------------------

    //全国所有行为的流向 开始
    //下载2014年经理自己省份所有的流向-
    function download_2014_allPlans() {
        $('#myModal1').modal('show');
        //调用进度条
        start_progress();
        action = "download_2014_allPlans";
    }
    //下载2015年经理自己省份所有的流向-
    function download_2015_allPlans() {
        $('#myModal1').modal('show');
        //调用进度条
        start_progress();
        action = "download_2015_allPlans";
    }
    //下载2016年经理自己省份所有的流向-
    function download_2016_allPlans() {
        $('#myModal1').modal('show');
        //调用进度条
        start_progress();
        action = "download_2016_allPlans";
    }
    //下载2017年经理自己省份所有的流向-
    function download_2017_allPlans() {
        $('#myModal1').modal('show');
        //调用进度条
        start_progress();
        action = "download_2017_allPlans";
    }
    //下载2018年经理自己省份所有的流向-
    function download_2018_allPlans() {
        $('#myModal1').modal('show');
        //调用进度条
        start_progress();
        action = "download_2018_allPlans";
    }
    //下载2019年经理自己省份所有的流向-
    function download_2019_allPlans() {
        $('#myModal1').modal('show');
        //调用进度条
        start_progress();
        action = "download_2019_allPlans";
    }
    //下载2017-2018年经理自己省份所有的流向-
    function download_2017_2018_allPlans() {
        $('#myModal1').modal('show');
        //调用进度条
        start_progress();
        action = "download_2017_2018_allPlans";
    }
    //下载2018-2019年经理自己省份所有的流向-
    function download_2018_2019_allPlans() {
        $('#myModal1').modal('show');
        //调用进度条
        start_progress();
        action = "download_2018_2019_allPlans";
    }
    //下载2018-2019年经理自己省份所有的流向-简
    function download_2018_2019_allPlans_J() {
        $('#myModal1').modal('show');
        //调用进度条
        start_progress();
        action = "download_2018_2019_allPlans_J";
    }
    //下载2018-2019年经理自己省份所有的流向-全
    function download_2018_2019_allPlans_Q() {
        $('#myModal1').modal('show');
        //调用进度条
        start_progress();
        action = "download_2018_2019_allPlans_Q";
    }
    //下载2018-2019年经理自己省份所有的流向-中
    function download_2018_2019_allPlans_Z() {
        $('#myModal1').modal('show');
        //调用进度条
        start_progress();
        action = "download_2018_2019_allPlans_Z";
    }
    //全国所有行为的流向 结束

    //经理下载自己的协议 ----------------start---------------------------------------------
    function download_policy_self() {
        $('#myModal1').modal('show');
        //调用进度条
        start_progress();
        action = "download_policy_self";
    }
    //经理下载自己的协议 ----------------end---------------------------------------------

     function download_policy() {
        $('#myModal1').modal('show');
        //调用进度条
        start_progress();
        action = "download_policy";
    }
    
    
    //经理自己省份每年所有的流向---------------------start-------------------------
    //下载2014年经理自己省份所有的流向-
    function download_2014_allPlans_self() {
        $('#myModal1').modal('show');
        //调用进度条
        start_progress();
        action = "download_2014_allPlans_self";
    }
    //下载2015年经理自己省份所有的流向-
    function download_2015_allPlans_self() {
        $('#myModal1').modal('show');
        //调用进度条
        start_progress();
        action = "download_2015_allPlans_self";
    }
    //下载2016年经理自己省份所有的流向-
    function download_2016_allPlans_self() {
        $('#myModal1').modal('show');
        //调用进度条
        start_progress();
        action = "download_2016_allPlans_self";
    }
    //下载2017年经理自己省份所有的流向-
    function download_2017_allPlans_self() {
        $('#myModal1').modal('show');
        //调用进度条
        start_progress();
        action = "download_2017_allPlans_self";
    }
    //下载2018年经理自己省份所有的流向-
    function download_2018_allPlans_self() {
        $('#myModal1').modal('show');
        //调用进度条
        start_progress();
        action = "download_2018_allPlans_self";
    }
    //下载2019年经理自己省份所有的流向-
    function download_2019_allPlans_self() {
        $('#myModal1').modal('show');
        //调用进度条
        start_progress();
        action = "download_2019_allPlans_self";
    }
    //下载2018年经理自己省份所有的流向-
    function download_2017_2018_allPlans_self() {
        $('#myModal1').modal('show');
        //调用进度条
        start_progress();
        action = "download_2017_2018_allPlans_self";
    }
    //下载2018年经理自己省份所有的流向-
    function download_2018_2019_allPlans_self() {
        $('#myModal1').modal('show');
        //调用进度条
        start_progress();
        action = "download_2018_2019_allPlans_self";
    }
    //经理自己省份每年所有的流向---------------------end-------------------------



    //下载2018年纯销流向 自己省份的
    function download_all2018CxPlans_self() {
        $('#myModal1').modal('show');
        //调用进度条
        start_progress();
        action = "download_all2018CxPlans_self";
    }
    //下载2018年销售流向
    function download_all2018XsPlans() {
        $('#myModal1').modal('show');
        //调用进度条
        start_progress();
        action = "download_all2018XsPlans";
    }
    //下载2018年销售流向 自己省份的
    function download_all2018XsPlans_self() {
        $('#myModal1').modal('show');
        //调用进度条
        start_progress();
        action = "download_all2018XsPlans_self";
    }
    //下载时间理论库存
    function download_time_kucun() {
    	if($("#kucunDate").val() == ""){
    		alert("请选择截止日期");
    		$("#kucunDate").focus();
    		return;
    	}
        $('#myModal1').modal('show');
        //调用进度条
        start_progress();
        action = "downloadTimeInventory";
    }
    //下载经理签到
    function download_mgr_qiandao() {
    	if($("#startTime").val() == ""){
    		alert("请选择开始日期");
    		$("#startTime").focus();
    		return;
    	}
    	if($("#endTime").val() == ""){
    		alert("请选择结束日期");
    		$("#endTime").focus();
    		return;
    	}
        $('#myModal1').modal('show');
        //调用进度条
        start_progress();
        action = "downloadMgrQianDao";
    }
    var year;
    var startMonth;
    var endMonth;
    var product;
    //下载千盒区县Q1
    function download_CountryOver1kQ1(y,sm,em,p) {
        $('#myModal1').modal('show');
        //调用进度条
        start_progress();
        year = y;
        startMonth = sm;
        endMonth = em;
        product = p;
        action = "downloadCountryOver1k";
    }
    //下载千盒区县Q2
    function download_CountryOver1kQ2(y,sm,em,p) {
        $('#myModal1').modal('show');
        //调用进度条
        start_progress();
        year = y;
        startMonth = sm;
        endMonth = em;
        product = p;
        action = "downloadCountryOver1k";
    }
    //下载千盒区县Q3
    function download_CountryOver1kQ3(y,sm,em,p) {
        $('#myModal1').modal('show');
        //调用进度条
        start_progress();
        year = y;
        startMonth = sm;
        endMonth = em;
        product = p;
        action = "downloadCountryOver1k";
    }
    //下载千盒区县Q4
    function download_CountryOver1kQ4(y,sm,em,p) {
        $('#myModal1').modal('show');
        //调用进度条
        start_progress();
        year = y;
        startMonth = sm;
        endMonth = em;
        product = p;
        action = "downloadCountryOver1k";
    }
    //下载千盒终端Q1
    function download_TerminalOver1kQ1(y,sm,em,p) {
        $('#myModal1').modal('show');
        //调用进度条
        start_progress();
        year = y;
        startMonth = sm;
        endMonth = em;
        product = p;
        action = "download_TerminalOver1k";
    }
    //下载千盒终端Q2
    function download_TerminalOver1kQ2(y,sm,em,p) {
        $('#myModal1').modal('show');
        //调用进度条
        start_progress();
        year = y;
        startMonth = sm;
        endMonth = em;
        product = p;
        action = "download_TerminalOver1k";
    }
    //下载千盒终端Q3
    function download_TerminalOver1kQ3(y,sm,em,p) {
        $('#myModal1').modal('show');
        //调用进度条
        start_progress();
        year = y;
        startMonth = sm;
        endMonth = em;
        product = p;
        action = "download_TerminalOver1k";
    }
    //下载千盒终端Q4
    function download_TerminalOver1kQ4(y,sm,em,p) {
        $('#myModal1').modal('show');
        //调用进度条
        start_progress();
        year = y;
        startMonth = sm;
        endMonth = em;
        product = p;
        action = "download_TerminalOver1k";
    }

    /***
     * 暂时没弄权限管理，简单处理，通过用户的lev来设置权限，>=1表示有权限，0表示没权限。
     */
    $(function(){
        sendRequest(pageContextPath + "/user/getCurrentLoginUser.do", null, function (jsonData) {
            var user = jsonData.user;
            if(user != null&&user.lev >= 1){
                $(".isDownload").each(function(){
                    $(this).fadeIn(3000);
                });
            } else {
                $(".isDownload").each(function(){
                    $(this).fadeOut(1);
                });
                $(".showNoAuth").each(function(){
                    $(this).fadeIn(3000);
                });
            }
        });
    });
</script>
</body>
<!-- END BODY -->
</html>